#!/bin/sh
# $Id: init.d-iked.in,v 1.2 2005/10/28 02:35:23 miyazawa Exp $
# iked startup script
#

prefix=/usr/local/racoon2
exec_prefix=${prefix}

NAME=iked
DAEMON=${exec_prefix}/sbin/$NAME
PIDFILE=/var/run/$NAME.pid

test -x $DAEMON || exit 0

set -e

case "$1" in
start)
	echo -n "Starting $NAME"
	$DAEMON -F -D 7 -v &
	echo "."
	;;
stop)
	echo -n "Stopping $NAME"
	read pid junk < $PIDFILE && kill $pid
	echo "."
	;;
restart)
	$0 stop
	$0 start
	;;
reload)
	echo -n "Reloading $NAME"
	read pid junk < $PIDFILE && kill -HUP $pid
	echo "."
	;;
*)
	echo "usage: $0 {start|stop|restart|reload}"
	exit 1
	;;
esac

exit 0
